home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Dots & Pixels / headers / C_randomizer.h < prev    next >
C/C++ Source or Header  |  1995-09-29  |  603b  |  31 lines

  1. #pragma once
  2.  
  3. #ifdef __cplusplus
  4.     extern "C" {
  5. #endif
  6.  
  7.     extern int seed_24_index;
  8.     extern int seed_55_index;
  9.     unsigned long randomizer_step( void);
  10.     /*
  11.     // randomizer_fill is supposed to be faster than doing
  12.     // 
  13.     //    for( int i = 0; i < numSteps; i++)
  14.     //    {
  15.     //        *start++ = randomizer_step();
  16.     //    }
  17.     */
  18.     void randomizer_fill( unsigned long *start, long numSteps);
  19.  
  20.     double randomizer_a_double( void);
  21.  
  22.     void randomizer_reseed( unsigned long seed);
  23.  
  24. #ifdef __cplusplus
  25.     }
  26. #endif
  27.  
  28. #define randomizer_a_coin() (randomizer_step() & 1)
  29.  
  30. #define randomizer_an_int(num_values) (randomizer_step() % num_values)
  31.